<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ page language="java" import="java.lang.*" %>
<%@ page language="java" import="OnlineExam.*" %>

<% 
	String testId = request.getParameter ("testId");
	Test test = Test.retrieveTest (testId);
	session.setAttribute ("TEST",test);
%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<TITLE>Answer Paper for <%= test.getCategoryId() %></TITLE>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" /
<body>
<jsp:include page="common/header.jsp"/>

<form action="EvaluateAnswerPaper.do" method="POST">

<center><h2><b>Category : <%= test.getCategoryId() %></b></h2></center><br>
<center><table><tr><td><b>TestId : <%= testId %></b></td></table></center><br /><br />
<%@page language="java" import="OnlineExam.*, OnlineExam.question.*, java.util.*" %>
<% 
	List<QuestionAnswer> list = test.retrieveGivenAnswers();
	int i=0;
	for (ListIterator iter = list.listIterator(); iter.hasNext();)
	{
		QuestionAnswer qa = (QuestionAnswer) iter.next();
		
		Question question = Question.retrieveQuestion (qa.getQuestionNumber());
%>
		<b>Question: <%= (i+1) %> <br /><br /><%=question.getQuestion()%> </b><br/><br/>
<%
		String answers[] = question.splitOptions ();

		for (int j = 0; j < answers.length; j++)
		{
%>
			<%=(j+1)%><b>.</b><%=answers[j]%><br /><br/>	
<%
		}
%>
		<br/><br/><b>The Given Answer is :  </b> <%= qa.getAnswer() %> <br /><br/>
		<font color="red"><td><b>The Correct Answer is : </b></td>A<%= question.getCorrectAnswer() %><br/><br/></font>
		<br /><td><b>Marks Scored : </b><%= qa.getMarksScored() %><b> out of </b> <%= qa.getMaximumMarks()%></td><br/><br/>
<%
		if (question.needsExplanation())
		{
%>
			<td><b>Given the Explanation for the Answer : </b></td>
			<td><%= qa.getExplanation() %></td>
			<br/><br/>
			<br /><font color="red"><td><b>The Correct Explanation : </b></td><br /> <%= question.getExplanation() %> <br /></font>
			<br /><td><b>Marks Scored : </b><%= qa.getMarksScored() %><b> out of </b> <%= qa.getMaximumMarks()%></td><br/><br/>
			<br /><td><b>Marks to be awarded out of <%= qa.getMaximumMarks() %></b></td>
			<td> <input type="text" name="expMarks<%=i%>" value="<%=qa.getMarksScored()%>" size="3"> </td>
			<br />

			<b><font color"blue">Evaluator's Comments </b></font>
			<td><textarea name="evaluatorsComments<%=i%>"></textarea> </td>
<%
		}
%>
		<br/><br/><hr />
<%
		i++;
	}
%>
</tr>
<br /><br/><br/>
<input type="Submit" value="Submit">
</form>
<jsp:include page="common/footer.jsp"/>
</body>
</html>
